    const state = {
        userName:'张三'
    };
    let getters =  {
        USER_NAME: state => {
           return  state.userName;
        }
    }
    ;
    const mutations = {
        ON_USER_NAME(state,val) {
            state.userName = val?val: state.userName
        }
    };
    const actions = {
        ON_USER_NAME(context,val) {
            return new Promise((resolve,reject) => {
                if(val){
                    setTimeout(function() {
                        resolve( context.commit('ON_USER_NAME',val))
                    },1000)
                }else {
                    reject(new Error('$store.dispatch(请带修改值)'))
                }
            })
        }
    };
export  default {
    state,
    getters,
    mutations,
    actions
}